import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;

public class Email {

    public static void emailTest(String FromEmail,String ToEmail,
                                 String subject,String message){
        SimpleEmail email = new SimpleEmail();
        email.setSslSmtpPort("465");
        email.setHostName("smtp.qq.com");
        email.setAuthentication(FromEmail, "corcjolpcbtidecc");
        email.setCharset("UTF-8");
        try {
            email.addTo(ToEmail);
            email.setFrom(FromEmail);
            email.setSubject(subject);
            email.setMsg(message);
            email.send();
        } catch (EmailException e) {
            e.printStackTrace();
        }
    }
}
